package com.chanzany.factory.factoryMethod;


public class Client {
    public static void main(String[] args) {
        order("BJ","cheese");
    }
    public static void order(String location, String type) {
        Pizza pizza =  PizzaFactory.createPizza(location,type);
        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();
    }
}

abstract class Pizza {
    protected String name;
    public abstract void prepare();
    public void bake() {
        System.out.println(name + " baking;");
    }
    public void cut() {
        System.out.println(name + " cutting;");
    }
    public void box() {
        System.out.println(name + " boxing;");
    }
    public void setName(String name) {
        this.name = name;
    }
}

class BJCheesePizza extends Pizza {
    @Override
    public void prepare() {
        System.out.println(name + " preparing;");
    }
}
class BJPepperPizza extends Pizza {
    @Override
    public void prepare() {
        System.out.println(name + " preparing;");
    }
}
class LDCheesePizza extends Pizza {
    @Override
    public void prepare() {
        System.out.println(name + " preparing;");
    }
}
class LDPepperPizza extends Pizza {
    @Override
    public void prepare() {
        System.out.println(name + " preparing;");
    }
}